from flask_restx import Resource

from app.common.libs import auth, permission_control


class OrganizerBase(Resource):
    # 身份认证,校验,类似装饰器函数 配合视图类使用
    decorators = [
        permission_control,
        auth.login_required,
    ]

    def __init__(self, api=None, *args, **kwargs):
        super().__init__(api=api, *args, **kwargs)
        self.user = auth.current_user()
